package com.zl.mywork.controller;

import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/redis")
public class RedisController {

    @Resource
    private RedisTemplate redisTemplate;

    @GetMapping("/get")
    public String getBooks(){

        Object hello = redisTemplate.opsForValue().get("hello");
        System.out.println(hello);
        System.out.println(hello);
        redisTemplate.opsForValue().set("wodefa","wodefa");
        System.out.println(redisTemplate.opsForValue().get("wodefa"));

        System.out.println(3);
        System.out.println(4);
        System.out.println("master");
        return "book";
    }

}
